/*--------------------------------------------------------------
 * File: device1.h 编码类型：C语言  UTF-8
 * Author WRS (1352509846@qq.com)
 * 功能: 模拟的设备1功能
 * Version 0.1
 * Date 2024-04-29 
 * 
 * @copyright Copyright (c) 2024
 * 
----------------------------------------------------------------*/
#ifndef __DEVICE1_H
#define	__DEVICE1_H

#ifdef __cplusplus
extern "C" {
#endif
#include "stdio.h"
#include "stdint.h"
#include "esp_err.h"

typedef struct
{
    uint8_t coils_port0;
    uint8_t coils_port1;
    uint8_t coils_port2;
} coil_reg_params_t;

typedef struct
{
    uint16_t input_data0;
    uint16_t input_data1;
    uint16_t input_data2;
    uint16_t input_data3;
    uint16_t data[50];
    uint16_t input_data4;
} input_reg_params_t;

typedef struct
{
    uint16_t holding_data0;
    uint16_t holding_data1;
    uint16_t holding_data2;
    uint16_t holding_data3;
    uint16_t test_regs[50];
    uint16_t holding_data4;
} holding_reg_params_t;

esp_err_t Device1_init(void);

void Device1_Start(void);
void Device1_stop(void);

#ifdef __cplusplus
}
#endif


#endif